﻿@model IEnumerable<MobileSales.Model.Orders.OrderItem>

<table class="datatable">
    <thead>
    <tr>
        <th style="width:160px;"></th>
        <th>@ModelStrings.Name</th>
        <th>@ModelStrings.Sku</th>
        <th>@ModelStrings.Price</th>
        <th>@ModelStrings.Tax</th>
        <th>@Strings.PriceWithTax</th>
        <th>@ModelStrings.Quantity</th>
        <th>@ModelStrings.Unit</th>
        <th>@ModelStrings.Value</th>
    </tr>
    </thead>
    <tbody>
    @foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(Strings.Edit, "EditItem", new { id = item.Id }, new { @class = "icon-button edit-icon" }) |
            @Html.ActionLink(Strings.Delete, "DeleteItem", new { id = item.Id }, new { @class = "icon-button delete-icon" })
        </td>
        <td>@item.Product.Name</td>
        <td>@item.Product.Sku</td>
        <td>@String.Format("{0:F}", Html.PriceCount(item.Product.Price, 0, item.Product.Spread, 1))</td>
        <td>@Html.PercentageFormat(item.Product.Tax.Value)</td>
        <td>@String.Format("{0:F}", Html.PriceCount(item.Product.Price, item.Product.Tax.Value, item.Product.Spread, 1))</td>
        <td>@item.Quantity</td>
        <td>@item.Product.Unit.Name</td>
        <td>@String.Format("{0:F}", Html.PriceCount(item.Product.Price, item.Product.Tax.Value, item.Product.Spread, item.Quantity))</td>

    </tr>
    }
    </tbody>
</table>

